package com.liang.drug.mapstruct;


import com.liang.drug.dto.RegisterDTO;
import com.liang.drug.entity.User;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

/**
 * Created with Intellij IDEA
 *
 * @Auther: liangjy
 * @Date: 2022/01/12/15:35
 * @Description: 对象转换 DTO实体是前端传来的对象，Entity是数据库对应的字段实体对象
 * 用户转换 RegisterDTO转CustomEntity
 */
@Mapper
public interface UtilStruct extends OrderMapper{
    @Mappings({
            @Mapping(target = "id", source = "customId"),
            @Mapping(target = "username", source = "name"),
            @Mapping(target = "password", source = "loginName"),

    })
    User  convert(RegisterDTO registerDTO);

}
